Tensorflow.js是由Google开发的开源库,用于在浏览器或节点环境中运行机器学习模型以及深度学习神经网络。
.env() 函数用于返回当前环境,即全局实体。此外,环境对象包括评估的属性值以及动态平台。
用法:
tf.env()
参数:此方法不保存任何参数。
返回值:它返回 tf.Environment。
范例1:
Javascript
// Importing the tensorflow.js library
import * as tf from "@tensorflow/tfjs"
// Calling env() and getBool() method
// along with its parameter
const res = tf.env().getBool('WEBGL_RENDER_FLOAT32_ENABLED');
// Printing output
console.log(res);
输出:
true
范例2:
Javascript
// Importing the tensorflow.js library
import * as tf from "@tensorflow/tfjs"
// Calling env() method's feature
const res1 = tf.env().features;
// Printing output
console.log(res1);
输出:
{ "WEBGL_FORCE_F16_TEXTURES":false, "WEBGL_VERSION":2, "WEBGL_RENDER_FLOAT32_CAPABLE":true, "WEBGL_RENDER_FLOAT32_ENABLED":true, "PROD":true, "DEBUG":true }
相关用法
- PHP imagecreatetruecolor()用法及代码示例
- p5.js year()用法及代码示例
- d3.js d3.utcTuesdays()用法及代码示例
- PHP ImagickDraw getTextAlignment()用法及代码示例
- PHP Ds\Sequence last()用法及代码示例
- PHP Imagick floodFillPaintImage()用法及代码示例
- PHP geoip_continent_code_by_name()用法及代码示例
- d3.js d3.map.set()用法及代码示例
- PHP GmagickPixel setcolor()用法及代码示例
- Tensorflow.js tf.layers.embedding()用法及代码示例
- PHP opendir()用法及代码示例
- d3.js d3.bisectLeft()用法及代码示例
注:本文由纯净天空筛选整理自nidhi1352singh大神的英文原创作品 Tensorflow.js tf.env() Function。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。